import MessageQueue from '../plugins/MessageQueue';

var registerService = {};
// 注册
registerService.register = function(call,phone,password,re_password,sms_code,cid,type_id){
	var params={
		phone:phone,
		password:password,
		re_password:re_password,
		sms_code:sms_code,
		cid:cid,
		type_id:type_id
	};
	MessageQueue('register?',params,function(msg){
		call(msg)
	},'POST')
}

// 获取验证码
registerService.getCode = function(call,phone,type_id){
	var params={
		phone:phone,
		type_id:type_id,
	};
	MessageQueue('register/get-code?',params,function(msg){
		call(msg)
	},'POST')
}

// 忘记密码
registerService.forgetPassword = function(call,phone,password,re_password,sms_code){
	var params={
		phone:phone,
		password:password,
		re_password:re_password,
		sms_code:sms_code,
	};
	MessageQueue('register/forget-password?',params,function(msg){
		call(msg)
	},'POST')
}
// 发送验证码
registerService.getCodeShop = function(call,phone){
	var params={
		phone:phone,
	};
	MessageQueue('register/get-code-shop?',params,function(msg){
		call(msg)
	},'POST')
}

module.exports = registerService;